var htmlwp = require('html-webpack-plugin');
module.exports={
	entry:'./src/main.js',

	output:{
		path:__dirname+'/dist',
		filename:'build.js'
	},
	module:{
		loaders:[
			{
				test:/\.css$/,
				loader:'style-loader!css-loader'
			},
			{
				test:/\.scss$/,
				loader:'style-loader!css-loader!sass-loader'
			},
			{
				test:/\.less$/,
				loader:'style-loader!css-loader!less-loader'
			},
			{
				test:/\.(png|jpg|gif|ttf)$/,
				loader:'url-loader?limit=20000'
			},
			{
				test:/\.js$/,
				loader:'babel-loader',
				exclude:/node_modules/
			},
			{
				test:/\.vue$/,
				loader:'vue-loader'
			}
		]
	},
	babel:{
            presets:['es2015'],  // 配置将es6语法转换成es5语法
            plugins:['transform-runtime'] // 用来解析vue文件
    },
	plugins:[
            	new htmlwp({
            	        title: '首页',  //生成的页面标题
            	        filename: 'index.html',
            	        template: 'index1.html' 
            	})
            ]
}